package com.allwees.support.payment.paypal.constant;

import lombok.Getter;

@Getter
public enum EPaypalWebHookEventType {

    CAPTURE("PAYMENT.CAPTURE.COMPLETED"),
    REFUNDED("PAYMENT.CAPTURE.REFUNDED"),
    CHECKOUT_APPROVED("CHECKOUT.ORDER.APPROVED"),
    SALE_COMPLETED("PAYMENT.SALE.COMPLETED"),
    PAYMENT_CREATED("PAYMENTS.PAYMENT.CREATED"),

    ;

    String value;

    EPaypalWebHookEventType(String value){
        this.value = value;
    }

    public static EPaypalWebHookEventType getByValue(String value){
        for (EPaypalWebHookEventType eventType : EPaypalWebHookEventType.values()){
            if(eventType.getValue().equalsIgnoreCase(value)){
                return eventType;            }

        }
        return null;
    }
}

